﻿// -----------------------------------------------------------------------
// <copyright file="IScene.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace MenuGame2DXNA
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.Media;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public enum SceneState { PLAY = 1, STOP, PAUSE }
    public abstract class Scene
    {
        protected Texture2D backGround;
        public SceneState State
        {
            get;

            set;

        }
        protected bool isPlayMusic;
        
        /// <summary>
        /// Loads the content.
        /// </summary>
        /// <param name="game">The game.</param>
        public virtual void LoadContent(Game game)
        {
            backGround = game.Content.Load<Texture2D>("Menu/background");
        }

        /// <summary>
        /// Plays this instance.
        /// </summary>
        public virtual void Play()
        {
            State = SceneState.PLAY;
        }
        /// <summary>
        /// Stops this instance.
        /// </summary>
        public virtual void Stop()
        {
            State = SceneState.STOP;
            MediaPlayer.Stop();
            isPlayMusic = false;
        }
        /// <summary>
        /// Pauses this instance.
        /// </summary>
        public virtual void Pause()
        {
            State = SceneState.PAUSE;
        }
        /// <summary>
        /// Resumes this instance.
        /// </summary>
        public virtual void Resume()
        {
            State = SceneState.PLAY;
        }
        /// <summary>
        /// Updates the specified game time.
        /// </summary>
        /// <param name="gameTime">The game time.</param>
        public virtual void Update(GameTime gameTime)
        {

        }
        /// <summary>
        /// Draws the specified game time.
        /// </summary>
        /// <param name="gameTime">The game time.</param>
        /// <param name="spriteBatch">The sprite batch.</param>
        public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            Rectangle destination = new Rectangle(
                     0, 0,
                      800, 600);
            Rectangle source = new Rectangle(0, 0, backGround.Width, backGround.Height);
            spriteBatch.Draw(backGround, destination, source, new Color(new Vector4(1f, 1f, 1f, 1f)));
        }

    }
}
